import pymysql


# class person:
#     def __init__(self, username, age, gender, high):
#         self.username = username
#         self.age = age
#         self.gender = gender
#         self.high = high

def delete(sql):
    db = pymysql.connect(
        host="localhost",
        user="root",
        password="123456",
        database="student",
        charset="utf8"
    )
    curses = db.cursor()
    curses.execute(sql)
    db.commit()
    curses.close()
    db.close()
    print("删除完毕")

def insert(sql, s):
    db = pymysql.connect(
        host="localhost",
        user="root",
        password="123456",
        database="student",
        charset="utf8"
    )
    curses = db.cursor()
    for i in s:
        curses.execute(sql, i)
    db.commit()
    curses.close()
    db.close()
    print("插入成功")

def select(sql):
    db = pymysql.connect(
        host="localhost",
        user="root",
        password="123456",
        database="student",
        charset="utf8"
    )
    curses = db.cursor()
    curses.execute(sql)
    datas = curses.fetchall()
    curses.close()
    db.close()
    print("查询成功")
    return datas



